﻿using Common;
using DAL.CodeManage;
using Model.CodeManage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL.CodeManage
{
   public class GenCodeBLL
    {
       GenCodeDAL dal = new GenCodeDAL();
       /// <summary>
       /// 获取所有的数据信息
       /// </summary>
       /// <returns></returns>
       public List<GenCodeModel> GetList(string term)
       {
           return dal.GetList(term);
       }
       /// <summary>
       /// 保存数据
       /// </summary>
       /// <param name="gencodeModel"></param>
       /// <returns></returns>
       public int SaveData(GenCodeModel gencodeModel)
       {
           return dal.SaveData(gencodeModel);
       }
       /// <summary>
       /// 保存生码任务信息
       /// </summary>
       /// <param name="model"></param>
       /// <returns></returns>
       public ResultEntity Add(GenCodeModel model)
       {

           return dal.Add(model);
       }
       /// <summary>
       /// 编辑生码任务
       /// </summary>
       /// <param name="model"></param>
       /// <returns></returns>
       public ResultEntity Update(GenCodeModel model)
       {
           return dal.Update(model);
       }

       /// <summary>
       /// 根据生码批次表id获取生码任务信息
       /// </summary>
       /// <param name="batchId"></param>
       /// <returns></returns>
       public GenCodeModel GetModelByBatch(int batchId)
       {
           return dal.GetModelByBatch(batchId);
       }
       /// <summary>
       /// 获取对应机构的最新的批次信息
       /// </summary>
       /// <param name="enterId"></param>
       public GenCodeBatch GetMaxBatchByEnterId(int enterId)
       {
           return dal.GetMaxBatchByEnterId(enterId);
       }
       /// <summary>
       /// 主键编号获得对应实体类信息
       /// </summary>
       /// <param name="id"></param>
       /// <returns></returns>
       public GenCodeModel GetModel(int id)
       {
           return dal.GetModel(id);
       }
    }
}
